import sqlite3

conn = sqlite3.connect('niit.sqlite')
cur = conn.cursor()
sql_query = 'select * from student'
# 得到查询结果集
data = cur.execute(sql_query)
# 循环结果集
for item in data:
    print("学号:", item[0], ',姓名:', item[1], ',年龄:', item[2])

conn.close()
